﻿<?xml version="1.0" encoding="utf-8" ?>
<DbDataRequest connection="$DBConnection$" type="$ForumDBType$" defaultFormatter="bizobj CompanyMembership(costs)">
  <SqlStatement hasResults="true">
    SELECT
    m.id, m.isActive, m.name, m.description,m.isDefault,m.createsNewCompany,m.userVisibility,m.minAge,
    c.id as costsid, c.timeLength, c.timeType, c.cost, c.description as costsdescription
    FROM CompanyMemberships m
    LEFT JOIN MembershipCosts c ON m.id = c.membershipId
    WHERE
    m.companyId = @companyId
    AND
    m.isActive = 1
    AND
    m.userVisibility = @userVisibility
  </SqlStatement>
  <Param name="companyId" type="UniqueIdentifier" />
  <Param name="userVisibility" type="NVarChar" />
</DbDataRequest>